package com.zelin.web.controller;

import com.zelin.pojo.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/10/15-15:46
 * ------------------------------
 */
@RequestMapping("/user")
@RestController
public class UserController {


    //1. 用户登录
    @RequestMapping("/login")
    //@ResponseBody    //此注解将java对象转换为json字符串
    public R login(){
        return R.ok().data("token",1);
    }

    //2. 登录成功后，获取用户信息
    @RequestMapping("/info")
    //@ResponseBody
    public R info(){
        return R.ok()
                .data("name","zelin")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");

    }
}
